home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Just Call Me Internet
/
Just Call Me Internet.iso
/
com
/
othernet
/
fidonet
/
btnc200
/
util.c
< prev
Wrap
C/C++ Source or Header
|
1993-01-29
|
1KB
|
68 lines
/*
** Program: BTNC
**
** Module: Utility functions
*/
#include <portab.h>
#include <ctype.h>
#include <string.h>
#include "general.h"
VOID CleanString(BYTE *source, BYTE *dest)
{
while (*source)
{
if (!isspace(*source) &&
!(*source == '\n')) *dest++ = *source;
source++;
}
*++dest = EOS;
}
VOID ReplaceUnderscores(BYTE *string)
{
while (*string)
{
if (*string == '_') *string = ' ';
string++;
}
}
BYTE *NextField(BYTE *start, BYTE *dest)
{
BYTE *runptr = start;
while ((*runptr) && (*runptr != ',')) *dest++ = *runptr++;
*dest = EOS;
if (!*runptr)
return (NULL);
else
return(++runptr);
}
VOID CodeSystemEntry (SYSTEM *sys, CSYSTEM *tmp)
{
BYTE *s = tmp->code;
tmp->hubnode = sys->hubnode;
tmp->maxbaud = sys->maxbaud;
tmp->modemtype = sys->modemtype;
tmp->flags = sys->flags;
strcpy (s, sys->sysname);
Last(s) = Last(s) | HB;
strcat (s, sys->location);
Last(s) = Last(s) | HB;
strcat (s, sys->operator);
Last(s) = Last(s) | HB;
strcat (s, sys->phone);
Last(s) = Last(s) | HB;
tmp->length = 10 + (UWORD)strlen(s);
}